<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    * {
        margin: 0;
        padding: 0;
    }

    #butwenben,
    #butxiala,
    #butdanxuan,
    #butduoxuan,
    #butduohang {
        width: 100px;
        height: 40px;
    }

    #box1,#box2,#box3,#box4,#box5 {
        width: 500px;
        height: 400px;
        background: yellow;
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        margin: auto;
    }
    /* #box2 {
        width: 500px;
        height: 400px;
        background: yellow;
        display: none;
    }
    #box3 {
        width: 500px;
        height: 400px;
        background: yellow;
        display: none;
    }
    #box4 {
        width: 500px;
        height: 400px;
        background: yellow;
        display: none;
    }
    #box5 {
        width: 500px;
        height: 400px;
        background: yellow;
        display: none;
    } */
</style>

<body>
    <button id="butwenben">文本框</button>
    <button id="butxiala">下拉框</button>
    <button id="butdanxuan">单选</button>
    <button id="butduoxuan">多选</button>
    <button id="butduohang">多行文本</button>
    <div id="box1">
        文本：<input type="text" placeholder="请输入文本">
        
    </div>
    <div id="box2">
        <select name="" id="">
            <option data="" type="">请选择</option>
        </select>
    </div>
    <div id="box3">
        <input type="radio">默认1
        <input type="radio">默认2
    </div>
    <div id="box4">
        <input type="checkbox">1
        <br>
        <input type="checkbox">2
    </div>
    <div id="box5">
        <textarea name="" id="" cols="30" rows="10">ubay </textarea>
    </div>

</body>
<script>
    window.onload = function () {
        // 文本框
        document.getElementById('butwenben').addEventListener('click', function () {
            document.getElementById('box1').style.display = 'block'

        })
        document.getElementById('butxiala').addEventListener('click', function () {
            document.getElementById('box2').style.display = 'block'

        })
        document.getElementById('butdanxuan').addEventListener('click', function () {
            document.getElementById('box3').style.display = 'block'


        })
        document.getElementById('butduoxuan').addEventListener('click', function () {
            document.getElementById('box4').style.display = 'block'


        })
        document.getElementById('butduohang').addEventListener('click', function () {
            document.getElementById('box5').style.display = 'block'


        })
    }

</script>

</html>